angular.module("config")
    .controller("indexController", function ($scope, $http) {
        $scope.ads = 3;
        var req_ad = {
            method: "GET",
            url: "food"
        };

        $http(req_ad)
            .then(function (res) {
                console.log(res.data);
                $scope.ads = res.data;
            });

        //waiting implement
        var req_merchant = {
            method: "GET",
            url: "merchant?mStatus=2"
        };

        $http(req_merchant)
            .then(function (res) {
                $scope.merchants = res.data;
            });

        //发gotoTop的style的标记位到父controller
        $scope.$emit("changeTopStyle", true);
    });